import { PropDt } from "../../../Framework/Common/CommonInterface";

const { ccclass, property } = cc._decorator;
@ccclass
export default class Prop extends cc.Component {
    //存储道具的坐标
    private _propTiledPos: cc.Vec2 = null;
    get propTiledPos() {
        return this._propTiledPos;
    }
    set propTiledPos(tiledPos: cc.Vec2) {
        this._propTiledPos = tiledPos;
    }
    private _propDt: PropDt = null;
    get propDt() {
        return this._propDt;
    }
    set propDt(propDt: PropDt) {
        this._propDt = propDt;
    }
    onInit() {
        this.startMove();
    }
    startMove() {
        cc.tween(this.node)
            .repeatForever(cc.tween(this.node)
                .by(0.3, { position: cc.v2(0, 10) })
                .by(0.3, { position: cc.v2(0, - 10) }))
            .start()
    }
    stopMove() {
        this.node.stopAllActions();
    }
}
